package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

/**
 * 系统通知
 */
@Getter
@Setter
public class SystemNotification extends BaseDomain{
    //状态
    private Integer state = 0;
    //关注
    private User attention;
    //游记
    private Travel travel;
    //类型
    private Long type;
    //用户
    private User user;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    public String getStateName() {
        String temp="";
        if (state == 0) {
            temp = "您的游记已被禁用";
        } else if (state== 1) {
            temp = "您的游记已被设置为推荐状态";
        } else if (state== 2){
            temp = "您的游记已审核通过";
        }else if (state== 4){
            temp = "您的游记正在审核中";
        }
        return temp;
    }


}